//===================================================================================
// $$
//
// Coder: Code Milker v1.0
// 0 - upper
// 1 - lower
//===================================================================================


namespace App.Domain.Handlers {
    using System;
    using App.Data;
    using App.Domain.Contracts;

    public class DeleteRecruiter {
        private readonly IRecruiterRepository _RecruiterRepository;

        public DeleteRecruiter(IRecruiterRepository RecruiterRepository) {
            _RecruiterRepository = RecruiterRepository;
        }

        public virtual void Execute(Guid recruiterId) {
            var RecruiterToDelete = _RecruiterRepository.GetRecruiter(recruiterId);

            if (RecruiterToDelete != null) {
                _RecruiterRepository.Delete(recruiterId);
            }
            else {
                throw new BusinessServicesException("UnableToDeleteVehicleExceptionMessage");
            }
        }
    }
}
